const { APP_PORT } = require('./config/config.default')

const app = require('./app')

const Goods = require('./model/goods.model')
const User = require('./model/user.model')
const Address = require('./model/addr.model')
const Cart = require('./model/cart.model')
const Order = require('./model/order.model')
//初始化数据库,如果没有表自动创建

// Goods.sync({ force: true })
// User.sync({ force: true })
// Address.sync({ force: true })
// Order.sync({ force: true })
// Cart.sync({ force: true })

Goods.sync()
User.sync()
Address.sync()
Order.sync()
Cart.sync()

app.listen(APP_PORT, () => {
  console.log(`server is running on http://localhost:${APP_PORT}`)
})
